<%@ page pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/student.css">
    <script src="js/jquery-1.9.1.min.js"></script>
    <script src="js/jquery.easyui.min.js"></script>

</head>
<body>
<s:debug/>
<form action="Stu_Add_Action.action" method="post" id="form1">
    <div class="container">
        <div class="content">
            <div class="header clearfix">
                <div class="top fl">当前位置>学生信息</div>
                <div class="bottom fr">
                    <%--                    //新增与编辑在同一个页面，可以根据stuid是否为空判断是新增还是编辑。--%>
                    <%--                    如果是新增，提交action为Stu_Add_Action--%>
                    <%--                    如果是修改，提交action为Stu_Edit_Action--%>
                    <%--                    利用<s:submit>标签的formaction属性修改表单Action--%>
                </div>
            </div>
            <div class="main">

                <!--基础信息-->
                <div class="BasicInformation">
                    <div class="title">基础信息</div>
                </div>
                <div class="content clearfix">
                    <div class="left fl">
                        <div>
                            <input type="hidden" name="StuId" value='<s:property value="student.stuId" />'/>
                            <label for="StuName">姓名：</label> <input id="StuName" name="StuName" type="text" value=''/>
                        </div>
                        <div>
                            <label for="Sex">性别：</label> 男：
                            <input type="radio" name="Sex" id="Sex" value="男" style="width: 20px; "> 女：<input
                                type="radio" name="Sex"
                                value="女" style="width: 20px;">
                            <script>
                                var val = '<s:property value="student.sex" />';
                                if (val !== "") {
                                    $("input[name='Sex']").each(function () {
                                        if ($(this).val() == val)
                                            $(this).attr("checked", "checked");
                                    })

                                }
                            </script>
                        </div>
                        <div>
                            <label for="Birthday">出生日期：</label> <input id="Birthday" name="Birthday" type="text"
                                                                       value="">
                        </div>
                        <div>
                            <label for="Phone">手机号码：</label> <input id="Phone" name="Phone" type="text" value="">
                        </div>
                    </div>
                    <div class="right fr">
                        <div>
                            <label for="StuNum">学号：</label> <input id="StuNum" name="StuNum" type="text" value="">
                        </div>
                        <div>
                            <label for="Nation">民族：</label> <input id="Nation" name="Nation" type="text" value="">
                        </div>
                        <div class="label">
                            <label for="politics">政治面貌：</label>
                            <div class="option clearfix" id="politics">
                                <select name="politics">
                                    <option value="中共党员">中共党员</option>
                                    <option value="共青团员">共青团员</option>
                                    <option value="群众">群众</option>
                                    <option value="无党派人士">无党派人士</option>
                                </select>
                                <input type="hidden" name="Policital" id="Policital"/>
                                <script>
                                    var val = '<s:property value="student.policital" />';
                                    $("#Policital").val(val);
                                    $("#pl_name").html(val);
                                </script>
                            </div>
                        </div>
                    </div>
                </div>
                <!--联系方式-->
                <div class="BasicInformation">
                    <div class="title">教育经历</div>
                </div>
                <div class="content clearfix">
                    <div>
                        <div>
                            <label for="schoolList" style="color:red">注意：请按照"小学:绿城文化小学,中学:实验中学"格式录入</label>
                            <textarea id="schoolList" name="schoolList" rows="4"
                                      style="width:889px;height:220px"></textarea>
                            <s:submit value="提交"/>
                            <script>
                                var val = '<s:property value="student.schoolList" escapeHtml="false"/>';
                                $("#schoolList").html(val.replace("<br/>", ","));
                            </script>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</form>
<script>
    $('#politics i').on('click', function () {
        $(this).siblings('ul').show();
    });
    $('#politics ul li').on('click', function () {
        var selTxt = $(this).text();
        $('#politics a').text(selTxt);
        $('#politics ul').hide();
    });

    function save() {
        $("#Policital").val($("#pl_name").text())
    }
</script>

</body>
